// @ts-ignore
import prompt from '@system.prompt';
import app from '@system.app';
import router from '@system.router';

export default {
    data: {
        title: "",
        item_icon: "",
        item_phone: "",
        //接收页面跳转时带的参数方式：定义名称和参数的名字一致即可
        addressItem: {},
        javaInterface: {}
    },
    onInit() {
        this.title = this.addressItem.item_name;
        this.item_icon = this.addressItem.item_icon
        this.item_phone = this.addressItem.item_phone
    },
    onShow() {
        // onInit生命周期中Java接口对象还未创建完成，请勿在onInit中调用。
        this.javaInterface = createLocalParticleAbility('com.pvj.addresslistdemo.MyLocalParticleAbility');
    },
    onClickBack() {
        router.back();
    },
    onClickPhone() {
        this.javaInterface.doDial(this.item_phone)
    },
    onClickMail() {
        this.javaInterface.doMessage(this.item_phone)
    }
}
